package com.itboye.mengwu.data.repository;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.reflect.TypeToken;
import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.utils.BaseErrorListener;
import com.itboye.core.utils.BaseSuccessReqListener;
import com.itboye.core.utils.ByJsonRequest.Builder;
import com.itboye.mengwu.data.interfaces.IMessgeInterface;
import com.itboye.mengwu.data.model.MessgeBean;

public class MessgeRepository extends BaseNetRepository implements
		IMessgeInterface<MessgeBean> {
	// 消息
	public static final String MeesgeQuery = "BY_Message_query";
	String api = "100";

	public MessgeRepository(ICompleteListener listener) {
		super(listener);
	}

	@Override
	public void add(MessgeBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void delete(MessgeBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(MessgeBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void getInfo(MessgeBean model) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<MessgeBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", model.getUid());
		map.put("msg_type", model.getMsg_type());
		// map.put("count", count);
		// map.put("psku_id", psku_id);
		(new Builder<MessgeBean>())
				.setTypeVerParamsAndReturnClass(MeesgeQuery, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<MessgeBean>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public List<MessgeBean> queryYouHuiQuan(MessgeBean model) {
		// TODO Auto-generated method stub
		return null;
	}

}
